< previous page page_199 next page >

Page 199
Solution 16
Serially Speaking
Let's take a closer look at the SDK description for the GetVolumeInformation function:
BOOL GetVolumeInformation(
  LPCTSTR lpRootPathName,           // address of root directory of the
                                    // file system
  LPTSTR lpVolumeNameBuffer,        // address of name of the volume
  DWORD nVolumeNameSize,            // length of lpVolumeNameBuffer
  LPDWORD lpVolumeSerialNumber,     // address of volume serial number
  LPDWORD lpMaximumComponentLength, // address of system's maximum
                                    // filename length
  LPDWORD lpFileSystemFlags,        // address of file system flags
  LPTSTR lpFileSystemNameBuffer,    // address of name of file system
  DWORD nFileSystemNameSize         // length of lpFileSystemNameBuffer
);
How much can you learn from the declaration alone without referring to the actual SDK documentation?
The only parameter you set ahead of time is the lpRootPathName parameter, which contains the root directory. The parameter type is LPCTSTR. This parses out as follows:
LP = Long (or far) pointer
C = Constant, meaning the parameter is not changed by the API function.
T =ANSI when calling the ANSI entry point, Unicode when calling the Unicode entry point. The appearance of a T parameter implies that the function almost certainly has two entry points, and that you'll use the one with the A suffix, in this case GetVolumeInformationA.
STR =String

 
< previous page page_199 next page >